package cc.avatar.model.dao;

import java.util.List;

import cc.avatar.model.AccountingRole;
import cc.avatar.model.Party;

public class PartyDao extends GenericEntityDao<Party> {
	public PartyDao(){
		super(Party.class);
	}
	
	@SuppressWarnings("unchecked")
	public List<Party> getAllPartyByRole(AccountingRole role){
		return super.getHibernateTemplate().find("from Party p where p.role=?", role);
	}
	
	@SuppressWarnings("unchecked")
	public List<Party> getAllActivePartyByRole(AccountingRole role){
		return super.getHibernateTemplate().find("from Party p where p.role=? and p.active = true", role);
	}
}

